public class Test {

    public static void main(String[] args) {
        SList sList=new SList();


        sList.addLast(3);
        sList.addLast(3);
        sList.addLast(3);
        sList.addLast(3);

        sList.removeElements(sList.getPhead(),3);

        sList.display();

    }

    public static void main2(String[] args) {

        SList sList=new SList();


        sList.addLast(1);
        sList.addLast(2);
        sList.addLast(3);
        sList.addLast(4);
        sList.addLast(3);
        sList.addLast(5);
        sList.addLast(3);

        sList.display();

        sList.removeAllKey(3);
        sList.display();
        sList.removeAllKey(2);
        sList.display();


    }


    public static void main1(String[] args) {

        SList sList=new SList();

//        sList.addFirst(1);
//        sList.addFirst(2);
//        sList.addFirst(3);
//        sList.addFirst(4);
//        sList.addFirst(5);

        sList.addLast(1);
        sList.addLast(2);
        sList.addLast(3);
        sList.addLast(4);
        sList.addLast(5);

        System.out.println(sList.size());


        sList.display();

        sList.addLast(88);

        System.out.println(sList.size());

        sList.display();

        sList.addIndex(0,666);
        System.out.println(sList.size());
        sList.display();
        sList.addIndex(6,799);
        System.out.println(sList.size());
        sList.display();
        //非法性测试
//        sList.addIndex(8,9595);
//        System.out.println(sList.size());
//        sList.display();

        System.out.println(sList.contains(666));
        System.out.println(sList.contains(88));
        System.out.println(sList.contains(9595));

        System.out.println("-----------------------------");

        sList.remove(666);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(88);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(4);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(88);
        sList.remove(199);
        sList.remove(799);
        sList.remove(1);
        sList.remove(2);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(3);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(5);
        System.out.println(sList.size());
        sList.display();
        System.out.println("-----------------------------");
        sList.remove(100);





        sList.clear();

    }

}
